<?php

session_start();
if(!array_key_exists("user", $_SESSION) || $_SESSION['account'] != 2){
	header("Location: ../common/redirect.php");
	exit;
}

include_once("../class/db.php");
$db = new db();

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>PIE EDUCATION | Educational Network</title>
<link rel="stylesheet" type="text/css" href="/css/style-student.css" />
<script type="text/javascript" src="/js/index.js"></script>
<script language="JavaScript" src="/js/ts_picker.js"></script>
<script language="Javascript1.2">
<!--
setTimeout('location.href="/logout.php?expire=1"',600000);
// -->
</script>
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-35230372-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>
</head>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td bgcolor="#000000"><table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="350" height="30">&nbsp;</td>
        <td align="right" valign="bottom"><a href="class.php" class="top-menu" style="color:#999">MY CLASS</a> <a href="schedule.php" class="top-menu" style="color:#999">CALENDAR</a> <a href="homework.php" class="top-menu" style="color:#999">HOMEWORK</a> <a href="test.php" class="top-menu" style="color:#999">EXAMS</a> <a href="grades.php" class="top-menu" style="color:#999">GRADES</a> <a href="tools.php" class="top-menu" style="color:#999">TOOLS</a> <a href="/logout.php" class="top-menu" style="color:#999">SIGN OUT</a></td>
      </tr>
	  <tr>
        <td>&nbsp;</td>
        <td align="right" valign="bottom"><a href="/profile/" class="login-menu" style="color:#FFF"><?php echo $_SESSION['name'].' '.$_SESSION['lname']; ?></a> <a href="/common/redirect.php" class="login-menu" style="color:#FFF">My Documents</a> <a href="/network/" class="login-menu" style="color:#FFF">My Wall</a> <a href="/common/settings.php" class="login-menu" style="color:#FFF">Settings</a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="30" style="background-image:url(/images/top-bg-student.png); background-repeat:repeat-x">&nbsp;</td>
  </tr>
  <tr>
  <td height="550" align="center"><form id="createclass" name="createclass" method="post" action="class-create-content.php" onsubmit="return classCreateValidation();">
    <table width="980" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td height="80"><img src="../images/course-creation-header.png" width="980" height="50" alt="Course Creation" /></td>
      </tr>
      <tr>
        <td align="right" valign="top"><input type=button class="submit-course" onClick="location.href='class.php'" value='Cancel Create Course' /></td>
      </tr>
      </table>
    <table width="980" border="0" cellspacing="2" cellpadding="2">
      <tr>
        <td height="50" colspan="2" style="font-size:14px; color:#999">Fill the form below to create a new course. After creating the course you will be asked to create content for the course. The content can be a video, a power point presentation, PDF, Rich Text content or just pictures. </td>
        </tr>
      <tr>
        <td width="200" height="30"><h2>Course Title <span style="color:#F00">*</span></h2></td>
        <td><input name="name" type="text" class="form-course" id="name" tabindex="1" /></td>
      </tr>
      <tr>
        <td height="30"><h2>Category <span style="color:#F00">*</span></h2></td>
        <td><select name="category" class="form-course" id="category" tabindex="2">
            <?php
				$sql = "SELECT * FROM course_category";
				$results = $db->execute($sql, "all");
				$counter = 1;
				foreach($results as $row){
					if($counter == 1){
						$selected = 'selected="selected"';
					} else {
						$selected = "";
					}
            		echo '<option value="'.$row['unique_id'].'" '.$selected.'>'.$row['course_name'].'</option>';
					$counter++;
				}
            ?>
          </select></td>
      </tr>
      <tr>
        <td height="30"> <h2>Grade Format <span style="color:#F00">*</span></h2></td>
        <td><select name="grade" class="form-course" id="grade" tabindex="3">
          <option value="1" selected="selected">A-F Format</option>
          <option value="2">Percentage Format</option>
        </select></td>
      </tr>
      <tr>
        <td height="30" valign="top"><h2>Course Landing <span style="color:#F00">*</span></h2></td>
        <td><select name="course_landing_type" class="form-course" id="course_landing_type" tabindex="4">
          <option value="video">Video Landing Content</option>
          <option value="text">Text Landing Content</option>
        </select></td>
      </tr>
      <tr>
        <td height="30" valign="top"><h2>Course Description <span style="color:#F00">*</span></h2></td>
        <td>
        <textarea name="description" class="form-course" id="description" tabindex="5" style="width: 700px; height: 100px;">Write a brief description of your course</textarea></td>
      </tr>
      <tr>
        <td height="30"><h2>Course Goal <span style="color:#F00">*</span></h2></td>
        <td><textarea name="course_goal" class="form-course" id="course_goal" tabindex="6" style="width: 700px; height: 100px;">What the user will learn with this course</textarea></td>
      </tr>
      <tr>
        <td height="30"><h2>Course Type <span style="color:#F00">*</span></h2></td>
        <td><select name="course_type" class="form-course" id="course_type" tabindex="7">
          <option value="1" selected="selected">The course is completly On-Line</option>
          <option value="2">The course is half On-Line and half On-Site</option>
          <option value="3">The course is completly On-Site</option>
        </select></td>
      </tr>
      <tr>
        <td height="30"><h2>After Buy It <span style="color:#F00">*</span></h2></td>
        <td><select name="after_buy_it" class="form-course" id="after_buy_it" tabindex="8">
          <option value="1" selected="selected">The course will be always available for the user</option>
          <option value="2">The course will expire after 1 month</option>
          <option value="3">The course will expire after 3 months</option>
          <option value="4">The course will expire after 6 months</option>
          <option value="5">The course will expire after 1 year</option>
          </select></td>
      </tr>
      <tr>
        <td height="30"><h2>Enable Affiliate <span style="color:#F00">*</span></h2></td>
        <td><select name="affiliate" class="form-course" id="affiliate" tabindex="9">
          <option value="50" selected="selected">50% to Affiliate</option>
          <option value="40">40% to Affiliate</option>
          <option value="30">30% to Affiliate</option>
          <option value="20">20% to Affiliate</option>
          <option value="10">10% to Affiliate</option>
          <option value="5">5% to Affiliate</option>
          <option value="0">I don't want the Affiliate Program</option>
          </select></td>
      </tr>
      <tr>
        <td height="30"><h2>Course Active <span style="color:#F00">*</span></h2></td>
        <td><select name="active" class="form-course" id="active" tabindex="10">
          <option value="1" selected="selected">Active</option>
          <option value="2">Inactive</option>
        </select></td>
      </tr>
      <tr>
        <td height="30"><h2>Start Date</h2></td>
        <td><input name="start_date" type="text" class="form-course" id="start_date" tabindex="12" value="" /> <a href="javascript:show_calendar('document.createclass.start_date', document.createclass.start_date.value);"><img src="/images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp"></a></td>
      </tr>
      <tr>
        <td height="30"><h2>End Date</h2></td>
        <td><input name="end_date" type="text" class="form-course" id="end_date" tabindex="12" value="" /> <a href="javascript:show_calendar('document.createclass.end_date', document.createclass.end_date.value);"><img src="/images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp"></a></td>
      </tr>
      <tr>
        <td height="30"><h2>Prerequisites Validation</h2></td>
        <td style="color:#F00; font-family:Arial, Helvetica, sans-serif"><select name="prerequisites_validation" class="form-course" id="prerequisites_validation" tabindex="13">
          <option value="0" selected="selected">No, don't validate the prerequisites</option>
          <option value="1">Yes, my course require the validation</option>
        </select></td>
      </tr>
      <tr>
        <td height="30"><h2>Prerequisites Description</h2></td>
        <td style="color:#F00; font-family:Arial, Helvetica, sans-serif"><textarea name="prerequisites" class="form-course" id="prerequisites" tabindex="14" style="width: 700px; height: 100px;">Describe the prerequisites for your course is any apply</textarea></td>
      </tr>
      <tr>
        <td height="30">&nbsp;</td>
        <td style="color:#F00; font-family:Arial, Helvetica, sans-serif"><em>all the fields marked with * are required fields</em></td>
      </tr>
      <tr>
        <td height="30">&nbsp;</td>
        <td height="60"><input name="send" type="submit" class="submit-center" id="send" tabindex="16" value="Create My New Course" /></td>
      </tr>
    </table>
  </form></td>
      </tr>
  <tr>
    <td height="30" align="center" style=" background-image:url(../images/bottom-bg-student.png); background-repeat:repeat-x;">&nbsp;</td>
  </tr>
  <tr>
    <td height="50"align="center" bgcolor="#000000" style="color:#fff; font-family:Arial, Helvetica, sans-serif">PIE.EDU All Rights Reserved 2012<br />
      <a href="/common/privacy.php" class="bottom-menu" style="color:#999">Privacy Policy</a> | <a href="/common/terms.php" class="bottom-menu"  style="color:#999">Terms of Use</a> | <a href="/help/main.php" class="bottom-menu" style="color:#999">Help Center</a> | <a href="/common/jobs.php" class="bottom-menu" style="color:#999">Jobs</a></td>
  </tr>
    </table>
</body>
</html>